import random

from hex import Hex
from tile import Tile
import game as Game
from listener import Listener

class Player:

    def __init__(self, name, game, isHuman):
        # initiate all my basic properties
        self.name = name
        self.game = game
        self.isHuman = isHuman
        self.heuristicState = 0
        
        self.income = 0
        self.reputation = 0
        self.money = 15
        self.population = 0
        
        self.listeners = []
        
        self.numResidential = 0
        self.numGovernment = 0
        self.numCommercial = 0
        self.numIndustry = 0
        self.numAirport = 0
        self.numRestaurant = 0
        self.numOffice = 0
        self.numSchool = 0
        self.numSkyscraper = 0
        self.numDealership = 0
        self.numRepAfterHurdle = 0
        self.numIncAfterHurdle = 0
        
        # initiate my board
        self.hexGrid = self.createHexGrid()               
        self.occupiedHexes = []
        self.playTile(self.game.getSuburbTile(), 28)
        self.playTile(self.game.getCommunityParkTile(), 29)
        self.playTile(self.game.getHeavyFactoryTile(), 30)
        self.validMoves = self.determineValidMoves()              
         
    def createHexGrid(self):
        hexGrid = []
        
        for i in range(63):
            newHex = Hex()
            adjacencies = self.determineAdjacencies(i)
            newHex.setAdjacencies(adjacencies)
            hexGrid.append(newHex)        
        
        return hexGrid
        
    def getTileWithMouse(self, x, y):
        if (x > 875 and x < 925) and (y > 80 and y < 140):
            tile = self.game.getStack()[6]
        elif (x > 875 and x < 925) and (y > 150 and y < 210):
            tile = self.game.getStack()[5]
        elif (x > 875 and x < 925) and (y > 220 and y < 280):
            tile = self.game.getStack()[4]
        elif (x > 875 and x < 925) and (y > 290 and y < 350):
            tile = self.game.getStack()[3]
        elif (x > 875 and x < 925) and (y > 360 and y < 420):
            tile = self.game.getStack()[2]
        elif (x > 875 and x < 925) and (y > 430 and y < 490):
            tile = self.game.getStack()[1]
        elif (x > 875 and x < 925) and (y > 500 and y < 560):
            tile = self.game.getStack()[0]
        elif(x > 1020 and x < 1080) and (y > 80 and y < 140) and self.getMoney() > 3:
            tile = self.game.getCommunityParkTile()
        elif(x > 1020 and x < 1080) and (y > 160 and y < 220) and self.getMoney() > 2:
            tile = self.game.getHeavyFactoryTile()
        elif(x > 1020 and x < 1080) and (y > 240 and y < 300) and self.getMoney() > 2:
            tile = self.game.getSuburbTile()
        else:
            return None  
        return tile
    
    def selectTile(self, x, y):
        tile = None
        if (x > 875 and x < 925) and (y > 80 and y < 140):
            tile = self.game.removeFromCurrentStack(6)
            tile.addToCost(10)
        elif (x > 875 and x < 925) and (y > 150 and y < 210):
            tile = self.game.removeFromCurrentStack(5)
            tile.addToCost(8)
        elif (x > 875 and x < 925) and (y > 220 and y < 280):
            tile = self.game.removeFromCurrentStack(4)
            tile.addToCost(6)
        elif (x > 875 and x < 925) and (y > 290 and y < 350):
            tile = self.game.removeFromCurrentStack(3)
            tile.addToCost(4)
        elif (x > 875 and x < 925) and (y > 360 and y < 420):
            tile = self.game.removeFromCurrentStack(2)
            tile.addToCost(2)
        elif (x > 875 and x < 925) and (y > 430 and y < 490):
            tile = self.game.removeFromCurrentStack(1)
        elif (x > 875 and x < 925) and (y > 500 and y < 560):
            tile = self.game.removeFromCurrentStack(0)
        elif(x > 1020 and x < 1080) and (y > 80 and y < 140) and self.getMoney() > 3:
            tile = self.game.communityPark
            self.game.removeCommunityPark()
        elif(x > 1020 and x < 1080) and (y > 160 and y < 220) and self.getMoney() > 2:
            tile = self.game.heavyFactory
            self.game.removeHeavyFactory()
        elif(x > 1020 and x < 1080) and (y > 240 and y < 300) and self.getMoney() > 2:
            tile = self.game.suburb
            self.game.removeSuburb()
        else:
            return None  
        return tile

    def tossMe(self, x, y):
        if (x > 875 and x < 925) and (y > 80 and y < 140) and (self.money > 9):
            self.game.removeFromCurrentStack(6)
            self.addMoney(-10)
        elif (x > 875 and x < 925) and (y > 150 and y < 210) and self.money > 7:
            self.game.removeFromCurrentStack(5)
            self.addMoney(-8)
        elif (x > 875 and x < 925) and (y > 220 and y < 280) and self.money > 5:
            self.game.removeFromCurrentStack(4)
            self.addMoney(-6)
        elif (x > 875 and x < 925) and (y > 290 and y < 350) and self.money > 3:
            self.game.removeFromCurrentStack(3)
            self.addMoney(-4)
        elif (x > 875 and x < 925) and (y > 360 and y < 420) and self.money > 1:
            self.game.removeFromCurrentStack(2)
            self.addMoney(-2)
        elif (x > 875 and x < 925) and (y > 430 and y < 490):
            self.game.removeFromCurrentStack(1)
        elif (x > 875 and x < 925) and (y > 500 and y < 560):
            self.game.removeFromCurrentStack(0)
        else:
            return 0
        return 1

    def takeTurn(self):
        print "\n" + self.name + "'s turn!"
        print "Starting with: (Money:", self.money, "Income:", self.income, "Population:", self.population, "Reputation:", str(self.reputation) + ")"
        
        # Purchase a tile
              
        suburbs = self.game.getSuburbStack()
        heavyFactories = self.game.getHeavyFactoryStack()
        communityParks = self.game.getCommunityParkStack()
        
        realEstate = self.game.getStack()[:7]
        realEstate[2].addToCost(2)
        realEstate[3].addToCost(4)
        realEstate[4].addToCost(6)
        realEstate[5].addToCost(8)
        realEstate[6].addToCost(10)
        purchases = suburbs + heavyFactories + communityParks + realEstate
        purchases = filter(lambda tile: tile.getCost() <= self.getMoney(), purchases)        
    
        moves = []
        for purchase in purchases:
            for hex in self.validMoves:
                value = self.getHeuristicValue(hex, purchase)
                moves.append((purchase, hex, value))
        
        for hex in self.occupiedHexes:
            id = self.hexGrid[hex].getTile().getID()
            lake = Tile(id, 'LAKE', 'None', '', -1, 0, 0, 0, 0, 0, 3, 'M', 'RGCI', 2, "A.jpg")
            moves.append((lake, hex, 0))
        moves = sorted(moves, key=lambda move: move[2])        
       
        if len(moves) == 0: #shouldn't happen?
            print self.name, "passes!"
            return
       
        purchasedTile = moves[len(moves)-1][0]
        hexIndex = moves[len(moves)-1][1]
             
        self.money -= purchasedTile.getCost()
             
        if (purchasedTile in realEstate):
            index = realEstate.index(purchasedTile)         
            self.game.removeFromCurrentStack(index)            
        elif (purchasedTile in suburbs):
            self.game.removeSuburb()
        elif (purchasedTile in heavyFactories):
            self.game.removeHeavyFactory()
        elif (purchasedTile in communityParks):
            self.game.removeCommunityPark()
                   
        print self.name, 'purchases a', purchasedTile.getName(), 'for $' + str(purchasedTile.getCost())   
        
        
        # Play purchased tile
        self.playTile(purchasedTile, hexIndex)
        # Determine new valid moves
        self.validMoves = self.determineValidMoves()
        # Collect or pay money
        self.money += self.income
        print self.income, "money added via income"
        # Adjust population
        self.population += self.reputation
        print self.reputation, "people added via reputation"
        print "Finishing with: (Money:", self.money, "Income:", self.income, "Population:", self.population, "Reputation:", str(self.reputation) + ")"
        
    def takeHumanTurn(self, tile, hex):
        print "\n" + self.name + "'s turn!"
        print "Starting with: (Money:", self.money, "Income:", self.income, "Population:", self.population, "Reputation:", str(self.reputation) + ")"
               
        if (tile != None):
            # Purchase a tile
            self.money -= tile.getCost()
            print self.name, 'purchases a', tile.getName(), 'for $' + str(tile.getCost())
            # Play purchased tile
            self.playTile(tile, hex)
        # Determine new valid moves
        self.validMoves = self.determineValidMoves()
        # Collect or pay money
        self.money += self.income
        print self.income, "money added via income"
        # Adjust population
        self.population += self.reputation
        print self.reputation, "people added via reputation"
        print "Finishing with: (Money:", self.money, "Income:", self.income, "Population:", self.population, "Reputation:", str(self.reputation) + ")"
        
        
    def getHeuristicValue(self, hexIndex, tile):
        moneyGain = tile.getMoney()
        peopleGain = tile.getPeople() 
        incomeGain = tile.getIncome()
        reputationGain = tile.getReputation() 
        tileAbility = tile.getAbilityID()
        tileIRPM = tile.getAbilityIRPM()
        tileStack = tile.getStack()
        stackMultiplier = 1
        adjGain = self.handleAdjacentAbilities(hexIndex, tile, False)
        playerGain = self.handlePlayerTileAbilities(tile, False)   
        #transition functions
        if self.heuristicState == 0:
            if self.game.getCurrentStack() != 0:
                self.heuristicState == 1
        elif self.heuristicState == 1:
            if self.game.getCurrentStack() == 2:
                self.heuristicState == 2
        
        
        #See what state we're in
        if self.heuristicState == 0: #early game
            
            incomeGain = incomeGain + adjGain[0] + playerGain[0]
            reputationGain = reputationGain + adjGain[1] + playerGain[1]
            peopleGain = peopleGain + adjGain[2] + playerGain[2]
            moneyGain = moneyGain + adjGain[3] + playerGain[3] 
            
            if (tileStack == -1):
                stackMultiplier = 0.25
            
            multiplier = 1
            if (tileAbility == 1):
                multiplier = 3
            elif (tileAbility == 2):
                multiplier = 3
            elif (tileAbility == 3):
                multiplier = 4
            elif (tileAbility == 4):
                multiplier = 3
            elif (tileAbility == 8):
                multiplier = 4
            elif (tileAbility == 9):
                multiplier = 2
                
            if (tileIRPM == 'I'):
                incomeGain = incomeGain * multiplier
            elif (tileIRPM == 'R'):
                reputationGain = reputationGain * multiplier
            elif (tileIRPM == 'P'):
                peopleGain = peopleGain * multiplier
            elif (tileIRPM == 'M'):
                moneyGain = moneyGain * multiplier
                
            if (self.income < 3 or self.money < 5):
                incomeGain = incomeGain * 3
            else:
                incomeGain = incomeGain * 2
            moneyGain = moneyGain * 2
    
            peopleGain = peopleGain / 10
            
        elif self.heuristicState == 1: #mid game
                
            incomeGain = incomeGain + adjGain[0] + playerGain[0]
            reputationGain = reputationGain + adjGain[1] + playerGain[1]
            peopleGain = peopleGain + adjGain[2] + playerGain[2]
            moneyGain = moneyGain + adjGain[3] + playerGain[3] 
            
            if (tileStack == -1):
                stackMultiplier = 0.1
            
            multiplier = 1
            if (tileAbility == 1):
                multiplier = 3
            elif (tileAbility == 2):
                multiplier = 3
            elif (tileAbility == 3):
                multiplier = 3
            elif (tileAbility == 4):
                multiplier = 4
            elif (tileAbility == 8):
                multiplier = 4
            elif (tileAbility == 9):
                multiplier = 3
                
            if (tileIRPM == 'I'):
                incomeGain = incomeGain * multiplier
            elif (tileIRPM == 'R'):
                reputationGain = reputationGain * multiplier
            elif (tileIRPM == 'P'):
                peopleGain = peopleGain * multiplier
            elif (tileIRPM == 'M'):
                moneyGain = moneyGain * multiplier
                
            if (self.income < 3 or self.money < 5):
                incomeGain = incomeGain * 5
            else:
                incomeGain = incomeGain * 2
            if (self.reputation < 5):
                reputationGain = reputationGain * 3
            else:
                reputationGain = reputationGain * 2
    
            peopleGain = peopleGain / 5
                
        elif self.ehuristicState == 2: #end game
                
            incomeGain = incomeGain + adjGain[0] + playerGain[0]
            reputationGain = reputationGain + adjGain[1] + playerGain[1]
            peopleGain = peopleGain + adjGain[2] + playerGain[2]
            moneyGain = moneyGain + adjGain[3] + playerGain[3] 
            
            if (tileStack == -1):
                stackMultiplier = 0.1
            
            multiplier = 1
            if (tileAbility == 1):
                multiplier = 4
            elif (tileAbility == 2):
                multiplier = 2
            elif (tileAbility == 3):
                multiplier = 2
            elif (tileAbility == 4):
                multiplier = 4
            elif (tileAbility == 8):
                multiplier = 5
            elif (tileAbility == 9):
                multiplier = 4
                
            if (tileIRPM == 'I'):
                incomeGain = incomeGain * multiplier
            elif (tileIRPM == 'R'):
                reputationGain = reputationGain * multiplier
            elif (tileIRPM == 'P'):
                peopleGain = peopleGain * multiplier
            elif (tileIRPM == 'M'):
                moneyGain = moneyGain * multiplier

            reputationGain = reputationGain * 3   
            peopleGain = peopleGain * 2
        
        return stackMultiplier * (incomeGain + reputationGain + peopleGain + moneyGain)
        
    def purchaseTile(self):
   
        # for now, buy one at random
        if (len(purchases) == 0):
            print self.name, "passes!" #fix later
            return None
            
        purchase = random.choice(purchases)
 
        return purchase
        
    def playTile(self, tile, index):
        hex = self.hexGrid[index]
        # Update immediate stats accordingly
        self.income += tile.getIncome()
        self.reputation += tile.getReputation()
        self.population += tile.getPeople()
        self.money += tile.getMoney()
        # Mark hex as occupied
        self.occupiedHexes.append(index)
        # Place the tile on the hex
        self.hexGrid[index].setTile(tile)
        self.updateStats(tile)
        oldAmt = self.getPopulation()
        # Check adjacent tiles for passive abilities
        adjResults = self.handleAdjacentAbilities(index, tile)
        playerResults = self.handlePlayerTileAbilities(tile)
        self.handleListenerAbilities(tile)
        self.addIncome(adjResults[0] + playerResults[0])
        self.addReputation(adjResults[1] + playerResults[1])
        self.addPopulation(adjResults[2] + playerResults[2])
        self.addMoney(adjResults[3] + playerResults[3])
        newAmt = self.getPopulation()
        count = self.game.checkForHurdles(oldAmt, newAmt)
        if count > 0:
            self.reputation -= count
            self.income -= count
            self.reputation += self.numRepAfterHurdle*count
            self.income += self.numIncAfterHurdle*count
        self.addListeners(tile)       
        
        
    def updateStats(self, tile):
        if (tile.getColor() == 'green'):
            self.addResidential()
        elif (tile.getColor() == 'grey'):
            self.addGovernment()
        elif (tile.getColor() == 'blue'):
            self.addCommercial()
        elif (tile.getColor() == 'yellow'):
            self.addIndustry()
            
        if (tile.getType() == 'AIRPORT'):
            self.addAirport()
        elif (tile.getType() == 'RESTAURANT'):
            self.addRestaurant()
        elif (tile.getType() == 'OFFICE'):
            self.addOffice()
        elif (tile.getType() == 'SCHOOL'):
            self.addSchool()
        elif (tile.getType() == 'SKYSCRAPER'):
            self.addSkyscraper()
        elif (tile.getType() == 'CAR DEALERSHIP'):
            self.addCarDealership()
        elif (tile.getAbilityID() == 8):
            if(tile.getAbilityModifier() == 'I'):
               self.numIncAfterHurdle = self.numIncAfterHurdle + 1
            else:
                self.numRepAFterHurdle = self.numRepAfterHurdle + 1
  
    # handles FOR EACH OF YOUR X
    def handlePlayerTileAbilities(self, tile, printStuff=True):
        result = [0, 0, 0, 0]
        if (tile.getAbilityID() == 4):
            tileIRPM = tile.getAbilityIRPM()
            tileModifier = tile.getAbilityModifier()
            tileAffecters = tile.getAbilityAffecters()
            totalAffecters = 0
            if ('R' in tileModifier):
                totalAffecters = tileAffecters * self.numResidential
            if ('G' in tileModifier): 
                totalAffecters = tileAffecters * self.numGovernment
            if ('C' in tileModifier):
                totalAffecters = tileAffecters * self.numResidential
            if ('I' in tileModifier):
                totalAffecters = tileAffecters * self.numIndustry
            
            irpm = -1
            if (tileIRPM == 'I'):
                irpm = 0
            elif (tileIRPM == 'R'):
                irpm = 1
            elif (tileIRPM == 'P'):
                irpm = 2
            elif (tileIRPM == 'M'):
                irpm = 3
            result[irpm] = result[irpm] + tileAffecters
                
            if printStuff:
                print tileAffecters, "added to", self.name + "'s", tileIRPM, "by", tile.getName(), "(via player's existing tiles)"   
        return result
        
    # check listeners to see if new tile affects anything
    def handleListenerAbilities(self, tile):
        for listener in self.listeners:
            listener.trigger(tile)
        for listener in self.game.listeners:
            if (not listener.otherPlayers or listener.player != self):
                listener.trigger(tile)
            
    # add listener if necessary for new tile       
    def addListeners(self, tile):
        abilityID = tile.getAbilityID()
        if (abilityID == 1 or abilityID == 2):
            listener = Listener(self, tile.getAbilityIRPM(), tile.getAbilityModifier(), tile.getAbilityAffecters())
            self.game.addListener(listener)
        elif (abilityID == 9):
            listener = Listener(self, tile.getAbilityIRPM(), tile.getAbilityModifier(), tile.getAbilityAffecters(), True)
            self.game.addListener(listener)
        elif (abilityID == 4):
            listener = Listener(self, tile.getAbilityIRPM(), tile.getAbilityModifier(), tile.getAbilityAffecters())
            self.listeners.append(listener)      
            
    # handles FOR EACH ADJACENT X
    def handleAdjacentAbilities(self, hexIndex, tile, printStuff=True):
        hex = self.hexGrid[hexIndex]

        tileColor = tile.getColor()
        tileIRPM = tile.getAbilityIRPM()
        tileModifier = tile.getAbilityModifier()
        tileAffecters = tile.getAbilityAffecters()
        result = [0, 0, 0, 0]
     
        adjacencies = self.determineAdjacencies(hexIndex)
        
        for adj in adjacencies:
            adjHex = self.hexGrid[adj]
            adjTile = adjHex.getTile()
            if adjTile == None:
                continue
            
            if (adjTile.getAbilityID() == 3): #adjacent tile has ability triggered by new tile
                adjIRPM = adjTile.getAbilityIRPM()
                adjModifier = adjTile.getAbilityModifier()
                adjAffecters = adjTile.getAbilityAffecters()
                
                if (('R' in adjModifier and tileColor == 'green') or
                    ('G' in adjModifier and tileColor == 'grey') or
                    ('C' in adjModifier and tileColor == 'blue') or
                    ('I' in adjModifier and tileColor == 'yellow')):
                    irpm = -1
                    if (adjIRPM == 'I'):
                        irpm = 0
                    elif (adjIRPM == 'R'):
                        irpm = 1
                    elif (adjIRPM == 'P'):
                        irpm = 2
                    elif (adjIRPM == 'M'):
                        irpm = 3
                    result[irpm] = result[irpm] + adjAffecters
                    
                if printStuff:
                    print adjAffecters, "added to", self.name + "'s", adjIRPM, "by", adjTile.getName(), "(via adjacency with previous tile)"
                      
            if (tile.getAbilityID() == 3): #new tile has ability triggered by adjacent  tile
                adjColor = adjTile.getColor()
                
                if (('R' in tileModifier and adjColor == 'green') or
                    ('G' in tileModifier and adjColor == 'grey') or
                    ('C' in tileModifier and adjColor == 'blue') or
                    ('I' in tileModifier and adjColor == 'yellow')):
                    irpm = -1
                    if (tileIRPM == 'I'):
                        irpm = 0
                    elif (tileIRPM == 'R'):
                        irpm = 1
                    elif (tileIRPM == 'P'):
                        irpm = 2
                    elif (tileIRPM == 'M'):
                        irpm = 3
                    result[irpm] = result[irpm] + tileAffecters        

                if printStuff:
                    print tileAffecters, "added to", self.name + "'s", tileIRPM, "by", tile.getName(), "(via adjacency with new tile)"
                
        return result
               
    def determineAdjacencies(self, i):
        adjacencies = []
        iMod7 = i % 7
        isEvenIndex = i % 2 == 0
        isEvenRow = (i / 7) % 2 == 0
        
        #hex directly above
        if iMod7 > 0:
            adjacencies.append(i - 1)
            
        #hex directly below
        if iMod7 < 6:
            adjacencies.append(i + 1)
            
        #ignore leftmost column
        if i > 6:
            
            #hex above and to the left
            if not isEvenRow:
                adjacencies.append(i - 7)
            elif iMod7 > 0:
                adjacencies.append(i - 8)
                
            #hex below and to the left
            if isEvenRow:
                adjacencies.append(i - 7)
            elif iMod7 < 6:
                adjacencies.append(i - 6)
                
        #ignore rightmost column
        if i < 56:
        
            #hex above and to the right
            if not isEvenRow:
                adjacencies.append(i + 7)
            elif iMod7 > 0:
                adjacencies.append(i + 6)
                
            #hex below and to the right
            if isEvenRow:
                adjacencies.append(i + 7)
            elif iMod7 < 6:
                adjacencies.append(i + 8)
                
        return adjacencies
         
    def determineValidMoves(self):
        validMoves = []
        
        for hexId in self.occupiedHexes:
            hex = self.hexGrid[hexId]
            for adjacency in hex.getAdjacencies():
                if adjacency not in validMoves and adjacency not in self.occupiedHexes:
                    validMoves.append(adjacency)
                    
        return validMoves

        
    # Getters and setters
        
    def getHexGrid(self):
        return self.hexGrid
        
    def getValidMoves(self):
        return self.validMoves

    def getIncome(self):
        return self.income 
        
    def getReputation(self):
        return self.reputation 
        
    def getMoney(self):
        return self.money
                
    def getPopulation(self):
        return self.population
              
    def setIncome(self, income):
        self.income = income
        if self.income > 15:
            self.income = 15
        elif self.income < -5:
            self.income = -5
        
    def addIncome(self, income):
        self.income = self.income + income
        if self.income > 15:
            self.income = 15
        elif self.income < -5:
            self.income = -5

    def setReputation(self, reputation):
        self.reputation = reputation
        if self.reputation > 15:
            self.reputation = 15
        elif self.reputation < -5:
            self.reputation = -5

    def addReputation(self, reputation):
        self.reputation = self.reputation + reputation
        if self.reputation > 15:
            self.reputation = 15
        elif self.reputation < -5:
            self.reputation = -5

    def setMoney(self, money):
        self.money = money
        if (self.money < 0):
            self.money = 0

    def addMoney(self, money):
        self.money = self.money + money
        if (self.money < 0):
            self.money = 0

    def setPopulation(self, population):
        self.population = population
        if (self.population < 0):
            self.population = 0

    def addPopulation(self, population):
        self.population = self.population + population
        if (self.population < 0):
            self.population = 0
        
    def getName(self):
        return self.name
        
    def getListeners(self):
        return self.listeners

    def getNumberResidential(self):
        return self.numResidential
    
    def getNumberGovernment(self):
        return self.numGovernment
    
    def getNumberCommercial(self):
        return self.numCommercial
    
    def getNumberIndustry(self):
        return self.numIndustry
    
    def getNumberAirport(self):
        return self.numAirport
    
    def getNumberRestaurant(self):
        return self.numRestaurant
    
    def getNumberOffice(self):
        return self.numOffice
    
    def getNumberSchool(self):
        return self.numSchool
    
    def getNumberSkyscraper(self):
        return self.numSkyscraper
        
    def addResidential(self):
        self.numResidential = self.numResidential + 1
        self.game.addResidential()
        
    def addGovernment(self):
        self.numGovernment = self.numGovernment + 1
        self.game.addGovernment()
        
    def addCommercial(self):
        self.numCommercial = self.numCommercial + 1
        self.game.addCommercial()
        
    def addIndustry(self):
        self.numIndustry = self.numIndustry + 1
        self.game.addIndustry()
        
    def addAirport(self):
        self.numAirport = self.numAirport + 1
        self.game.addAirport()
        
    def addRestaurant(self):
        self.numRestaurant = self.numRestaurant + 1
        self.game.addRestaurant()
        
    def addOffice(self):
        self.numOffice = self.numOffice + 1
        self.game.addOffice()
        
    def addSchool(self):
        self.numSchool = self.numSchool + 1
        self.game.addSchool()
        
    def addSkyscraper(self):
        self.numSkyscraper = self.numSkyscraper + 1
        self.game.addSkyscraper()
        
    def addCarDealership(self):
        self.numDealership = self.numDealership + 1
        self.game.addCarDealership()
        
    def getIsHuman(self):
        return self.isHuman
        
        
        
        